package com.lbs.jiepiaisi.config;

import com.lbs.jiepiaisi.bean.AccountLoginBean;
import com.lbs.jiepiaisi.bean.AlarmBean;
import com.lbs.jiepiaisi.bean.DeptsEntity;
import com.lbs.jiepiaisi.bean.EqnoLoginBean;
import com.lbs.jiepiaisi.bean.EquipBean;
import com.lbs.jiepiaisi.bean.HistoryTraceBean;
import com.lbs.jiepiaisi.bean.TracingBean;
import com.lbs.jiepiaisi.bean.UploadImageBean;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;


public interface ApiService {


    /** 告警列表*/
    @FormUrlEncoded
    @POST(UrlConstants.ALARM_LIST)
    Observable<AlarmBean> loadAlarmList(@Field("deptId") String deptId,
                                        @Field("size") int size,
                                        @Field("page") int page,
                                        @Field("eqNos") String eqNos);
    /** 查询下级账户*/
    @FormUrlEncoded
    @POST(UrlConstants.UNDERLING_DEPTS)
    Observable<DeptsEntity> loadDeptList(@Field("deptId") String deptId);

    /** 设备列表*/
    @FormUrlEncoded
    @POST(UrlConstants.EQUIP_LIST)
    Observable<EquipBean> loadEquipList(@Field("deptId") String deptId,
                                        @Field("page") int page,
                                        @Field("size") int size,
                                        @Field("status") String status,
                                        @Field("str") String str);
    /** 账号登录*/
    @FormUrlEncoded
    @POST(UrlConstants.ACCOUNT_LOGIN)
    Observable<AccountLoginBean> accountLogin(@Field("loginName") String account,
                                              @Field("password") String password);
    /** 历史轨迹*/
    @FormUrlEncoded
    @POST(UrlConstants.HISTORY_TRACE)
    Observable<HistoryTraceBean> loadHistoryTrace(@Field("eqNo") String eqNo,
                                                  @Field("startTime") String startTime,
                                                  @Field("endTime") String endTime);
    /** 实时跟踪*/
    @FormUrlEncoded
    @POST(UrlConstants.REAL_TRACE)
    Observable<TracingBean> loadTracing(@Field("eqNo") String eqNo);

    /** 设备号登录(安装拍照登录)*/
    @FormUrlEncoded
    @POST(UrlConstants.EQNO_LOGIN)
    Observable<EqnoLoginBean> eqnoLogin(@Field("eqNo") String eqNo);

    /** 检查照片数量*/
    @FormUrlEncoded
    @POST(UrlConstants.SEARCH_IMG)
    Observable<Object> loadImg(@Field("eqId") String eqId);

    /** 图片上传*/
    @POST(UrlConstants.UPLOAD_FILES)
    Observable<UploadImageBean> uploadFiles(@Body ProgressRequestBody body);

    /** 补拍上传*/
    @POST(UrlConstants.REPEAT_FILES)
    Observable<UploadImageBean> repeatUploadFiles(@Body ProgressRequestBody body);

    /** 实时跟踪*/
//    @FormUrlEncoded
//    @POST(UrlConstants.VIN_LOGIN)
//    Observable<VinLoginBean> vinLogin(@Field("vin") String vin, @Field("password") String password);

}
